package com.estore.dao;

import java.util.List;
import javax.sql.DataSource;

import com.estore.entity.MainCategories;
import com.estore.entity.Product;
import com.estore.entity.Categories;
import com.estore.entity.Brand;
import com.estore.entity.Product_Image;
//import com.estore.info.CatInfo;
import com.estore.info.ProductImageInfo;
import com.estore.info.ProductInfo;

public interface Product_Dao {

	public void setDataSource(DataSource datasource);
	
	public List<Categories> listAllCategories();

	public boolean checkCurrentCatName(Categories cat);
	
	public Categories getCategories(Integer mainCatID);

	public void addMainCategories(MainCategories mainCategories);
	
	public List<MainCategories> getAllMainCategories();
	
	public MainCategories viewMainCategories(Integer mainCatID);
	
	public void editMainCategories(MainCategories mainCategories);
	
	public boolean checkMainCategories(MainCategories main);
	
	public List<Categories> listSubCategories(Integer catID);

	public Brand getBrand(Integer brandID);

	public List<Brand> getListBrand();

	public List<MainCategories> listMainCategories();

	public List<Product> getListProduct(Integer catID);

	public List<Product> getListAllProduct();

	public void addProduct(ProductInfo info);

	public void addBrand(String brandName, String website);

	public boolean checkBrand(String brandName);

	public void updateBrand(Integer brandID, String brandName, String website);

	public void insertCategories(Categories cat);
	
	public void updateCategories(Categories info);
	
	public boolean checkCat(String catName);
	
	public boolean checkProduct(String productName);
	
	// get top 12 newest product with categories name, brand name and img display on homepage
	
	public List<ProductInfo> getTop12NewProduct();
	
	// list all product by sort type (newest =1 , hot = 2, discount = 3)
	
	public List<ProductInfo> getAllProduct(Integer sortType);
	
	// list product by cat 
	
	public List<ProductInfo> getProductByCat(Integer catID);
	
	// get detail product
	
	public ProductInfo getProductInfo(Integer ProductID);
	
	public void editProductDetail(ProductInfo info);
	
	public boolean checkCurrentProductName(String productName, String productID);
	
	public void deleteImage(String linkImg, String productID);
	
	public boolean checkMainImg(String productID, String imgType);
	
	public void setMainImg(String productID, String imgType);
	
	public void addNewImg(List<Product_Image> listProductImg);
	
	public ProductImageInfo getImageOfProduct(Integer productID, Integer imgType);
	
	// full-text-search product
	public List<ProductInfo> fullTextSearchResult(String searchText);
	
	// search exactly
	public List<ProductInfo> exactlySearchResult(String searchText);
	
	// get ID of 12 most favorite product
	public List<Integer> get12MostFavoriteProductID();
	
	// get all favorite count of a product
	public Integer getFavoriteCount(Integer productID);
}
